package crm8000.Controllers

import crm8000.Models.User;
import grails.converters.JSON

class UserController {

    static allowedMethods = [loginPOST: 'POST']

	def userService

	def login() {
		if (session.loginUserId) {
			redirect(uri: "/")
		}
	}
	
	def loginPOST() {
		def result = userService.doLogin(params.loginName, params.password)
		
		render result as JSON
	}
}
